package com.hd.trans.ui.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hd.trans.R;
import com.hd.trans.framework.dialog.Worker;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class RecordMenuAdapter extends BaseQuickAdapter<Worker, BaseViewHolder> {

    public RecordMenuAdapter(@Nullable List<Worker> data) {
        super(R.layout.item_record_menu, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder helper, Worker worker) {

        if(worker != null){
            Glide.with(helper.itemView.getContext())
                    .load(worker.getHeadRes())
                    .into((ImageView) helper.getView(R.id.iv_head));
            helper.setText(R.id.name,worker.getName());
        }
    }
}
